*. Sticky notes

This game takes some explaining.


The intro/demo text takes 14 characters per line. 16-bit script. Draws as
16x16 sprite tiles though. And each line is stored fixed-length @ BB022.

The first cutscene story narrative is stored somewhat differently. As 16-length
fixed sprite tiles. It stores a <start>/<end> pair of line #s. That tells the
game where to print text. Since everything is fixed-length. You'll see around
32 blocks of pointers. Starts @ BB26E.

Each script routine adds the basic sprite information to a SPRITE LIST. Cached in RAM
that is the brains of the rendering engine. The PC JMP table (01:76F4) handles every
variety of on-screen data imaginable.

; ---------------------------------------------------------------------------------
; ---------------------------------------------------------------------------------

The harder part comes with the printing routine. Code is written in some heavy
object-oriented programming. Tough usage of lookup tables that is shared among all
sprites. Each one has its own width/height pixel alignment factors.

RAM is used to cache the vram tile #s and other unknown stuff (01:74F0). And uses
tile recycling where possible (01:7FC0), although the vram can hold over 16*2 unique
16x16 sprite tiles with no problem. But again it uses lookup to share all sprites.
SATB table is @ 8E26 RAM (01:80B8).

More interestingly, the game runs through that cache each VBlank to rebuild the SATB
table. But the script is only read once. So to create a half-width 8x16 or variable one
will take some more thought.

; =================================================================================
; ---------------------------------------------------------------------------------
; =================================================================================

Free plug: SEKAS (68k assembler by Twilight Translations). Not available yet.
Further thoughts since asm68 will be a pain to write up.

; =================================================================================
; =================================================================================

Script is 16-bit. And fixed-length. 8-bit DTE could work based on the indexing math.
Or use a 32-bit dynamic remap.

ex. cutscene *_pseudo-code_*

org $00BD52
adda.w d4,a0		; read 32-bit remap pointer
move.l (a0),d4
move.l d4,a0

move.w ($fff448),d4	; 16-bit xpos script lookup
add.w d4,d4
adda.w d4,a0

move.b #$10,d4		; save text mode (CUTSCENE)
move.b d4,($fffe00)

; ---------------------------------------------------------------------------------
; ---------------------------------------------------------------------------------

We can only do 16 sprites per line. So the smaller tiles have to masquerade inside the
16x16 ones. But all of them go through the same printing routine, requiring some
traps for the FONT tiles only.

Printer checks for cached tiles @ 01:7FC0. In our case, we will always build font tiles
to make this work. 4-bpp font $174878. But we will do it elsewhere for practical reasons.

org $17FC0
move.l ($00FF8E1C),d7	; trap FONT sprite tiles
cmp.l $174878,d7
beq $18070		; skip tile building for FONT

; resume OLD code to check recycling


org $BD5C
move.w (a0),d4		; read script value

; INSERT TILE BUILDING CODE HERE (18042-1806A)
; - You'll have to keep track of your own tile # for vram writing (and WRAPPING).
;   Possibly several sections of video memory will be used (dump vram and check).
; - You can use the xpos for init conditions (FFF448==0)
;   Likely the control codes will reset the xpos. So you can contain everything that way.

Note that the first code is effectively ZAPPED. That's because the cache goes through
its list and will accidentally _rebuild_ unneeded tiles. For stronger control, we move
the creater to each scripting routine instead.

; ---------------------------------------------------------------------------------
; ---------------------------------------------------------------------------------

That leaves us with the SATB builder. Which has to handle sprite scrolling and attributes.
And re-runs every VBlank.

We should change the tile #s @ BDE8 and B6BA for our own purposes. Preferably set them
to the actual vram tile # instead. And we NEED to remember that everytime we read a script
code, the sprite list counter goes up. If we clear the last one written, then that tile won't
display. RECYCLE the last sprite used instead of adding a NEW one, to avoid problems and OVERFLOW.

Which takes us back to the raster engine again. We don't want indentation so 01:7F62 needs to read
a ZERO value if the FONT buffer is active (see above code). Same with 01:7F88, but A5 is our RAM
sprite list so leave it be. Towards 01:8070, use our custom VRAM TILE # which we stored @ $0026(A5).
If we use the engine's FONT VRAM tile storage format, it will store them backwards and in less usable
fashion. But only for FONT tiles.

The rest of the SATB should follow through. And the engine will update its own lists regarding
scrolls and line codes. So that we don't need to create a bloody mess with this already tough pipeline.

; =================================================================================
; ---------------------------------------------------------------------------------
; =================================================================================

The last notes are the non-existent dumper. There is a translation FAQ available.
And creating the dumper (512+ kanji identification) would _arguably_ take more time than
translating the screenshots.

But if you encounter a bitmap compression routine that is stored in all this rigidness, you could
APPEND a 32-bit header code ($FEED $DEEF). Before the algorithm starts with its first byte, use your
own trap to PEEK the first 4-bytes. If our magic code matches, then a decompression bypass occurs because
we can write our own RAW memory copy loop. Then resume normal flow after the STOP code is run.

Cheat codes give infinite health (minus obstacle crashes) and unlimited continues.

And changing the script line #s around may cause problems - engine looks for hard-coded
line values sometimes to update changes.

; ============================================================================
; ############################################################################
; ============================================================================

Atlas 1.06 is modified (nothing new since 'Little Master 3')

> #FILL( int stop_address, int file_byte )		- pads up to stop address
  #FILL( int start, stop, int file_byte )		- pads address range
  #FILL( int start, stop, int file_byte, string file )	- pads address range IN FILE

  #WARN( int warn_address )				- OKAY/BARF if PC counter >= warn_address

  #SAVEPC( string file_name )				- writes PC to file
  #LOADPC( string file_name )				- loads PC from file

  #INSERT( string file_name )				- inserts binary file at current PC

  MSB16,MSB24,MSB32,GB4xxx				- addressing modes

  #SETINDEX( int index_number, int size )		- init the index numbers
  #WRITEINDEX( int address, int index_bump )		- writes index numbers to address, # bytes
							  and auto-bumps the index #
  #WRITEINDEX( int addr, int index_bump, string file )	- writes index number to address IN FILE

  #SAVEINDEX( string file_name )			- writes INDEX # to file
  #LOADINDEX( string file_name )			- loads INDEX # from file

  #ALIGN( int byte_count )                      	- does file alignment (1,2,3,4)

  #W08BYTE( int address, int byte )			- writes byte to address (no JMP)
  #W08BYTE( int addr, int byte, string file )		- writes byte to address IN FILE (no JMP)

  #EMBCLEAR()						- erases all embedded pointers

  #SAVEPTRTABLE( PTRTABLE table, string file_name )	- writes PTRTABLE address to file
  #LOADPTRTABLE( PTRTABLE table, string file_name )	- loads PTRTABLE address from file 
